#include <iostream>
#include <exception>
#include "Hypo-Alg.h"

#include "IPC/IPCObject.h"

#include "Objects/wiiIface.h"

#include "Objects/swarmBin.h"
#include "Objects/swarmProc.h"

#include "gfx.h"

using namespace std;

int main( int argc, char ** argv ) {

	int seed = 0;

	if ( argc > 1 ) {
		seed = atoi( argv[1] );
	}

	if ( seed == 0 ) {
		seed = (unsigned)time(NULL);
	}

	std::cout << "\n----- KICKOFF -----\nYour Seed: " << seed << "\n----- KICKOFF -----\n\n";

	swarmBin  * sb = new swarmBin( 200, 200, 2, seed );

	swarmProc * sp = new swarmProc( sb );

//	sb->setColor( true );

	pthread_t procThread;
	pthread_t gfxThread;

	pthread_create( &procThread, NULL, thread_swarmProc, sp  );
	pthread_create( &gfxThread,  NULL, thread_gfx,       sb  );

	pthread_join ( procThread,  NULL );
	pthread_join ( gfxThread,  NULL );

}
